package org.example.client.messagehandler.chat;

import com.alibaba.fastjson2.JSONObject;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.example.client.message.chat.ChatRedirectToUserRequest;
import org.example.common.dispacher.MessageHandler;
import org.springframework.stereotype.Component;

/**
 * @title
 * @time 2025/6/16 23:36
 */
@Component
@Slf4j
public class ChatRedirectToUserRequestHandler implements MessageHandler<ChatRedirectToUserRequest> {
    /**
     * 处理消息
     * @param ch
     * @param message
     */
    @Override
    public void execute(Channel ch, ChatRedirectToUserRequest message) {
        log.info("[client] [ChatRedirectToUserRequestHandler] [execute] 接收到消息: {}", JSONObject.toJSONString(message));
    }

    /**
     * 获取消息类型
     * @return
     */
    @Override
    public String getType() {
        return ChatRedirectToUserRequest.TYPE;
    }
}
